package syntaxTree.classDecl;

import syntaxTree.id.*;
import syntaxTree.varDecl.*;
import syntaxTree.methodDecl.*;
public class classDeclNoExtends extends classDecl{
	id id;
	varDecl var;
	methodDecl met;
	public classDeclNoExtends(id id, varDecl var, methodDecl met)
	{
		this.cd = new classDeclInit();
		this.id = id;
		this.var = var;
		this.met = met;
	}
	public classDeclNoExtends(id id, varDecl var)
	{
		this.cd = new classDeclInit();
		this.id = id;
		this.var = var;
		this.met = new methodDeclInit();
	}
	public classDeclNoExtends(id id, methodDecl met)
	{
		this.cd = new classDeclInit();
		this.id = id;
		this.var = new varInit();
		this.met = met;
	}
	public classDeclNoExtends(id id)
	{
		this.cd = new classDeclInit();
		this.id = id;
		this.var = new varInit();
		this.met = new methodDeclInit();
	}
	public classDeclNoExtends(classDecl cd, id id, varDecl var, methodDecl met)
	{
		this.cd = cd;
		this.id = id;
		this.var = var;
		this.met = met;
	}
	public classDeclNoExtends(classDecl cd, id id, varDecl var)
	{
		this.cd = cd;
		this.id = id;
		this.var = var;
		this.met = new methodDeclInit();
	}
	public classDeclNoExtends(classDecl cd, id id, methodDecl met)
	{
		this.cd = cd;
		this.id = id;
		this.var = new varInit();
		this.met = met;
	}
	public classDeclNoExtends(classDecl cd, id id)
	{
		this.cd = cd;
		this.id = id;
		this.var = new varInit();
		this.met = new methodDeclInit();
	}
	public String toString()
	{
		return ("class "+id.toString()+" {\n\t "+var.toString()+"\n\t"+met.toString()+" \n}\n");
	}
	public String toC()
	{
		this.met.putClass(id);
		if(var.toC()=="")
			return ("typedef struct "+id.toC()+" {\n\tint i;\n}"+id.toC()+";\n"+met.toC());
		else
			return ("typedef struct "+id.toC()+" {\n\t "+var.toC()+"}"+id.toC()+";\n"+met.toC());
	}
}
